home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1993 November / JCSM Shareware Collection - 1993-11.iso / cl720 / sst115j.lzh / SSTSTR.H < prev    next >
C/C++ Source or Header  |  1992-03-23  |  5KB  |  100 lines

  1. /* ------------------------------------------------------------------------ */
  2. /*                                 sststr.h                                 */
  3. /*                                                                          */
  4. /*                        string handling functions                         */
  5. /*                                                                          */
  6. /*       CopyRight (C) 1991,1992  Steven Lutrov.  All rights reserved.      */
  7. /* ------------------------------------------------------------------------ */
  8.  
  9.  
  10. #ifdef EOS
  11. #  undef EOS
  12. #endif
  13. #define  EOS      '\x00'                     /* define end of string char */
  14.  
  15. #define ulong unsigned long
  16.  
  17. /* ------------------------------------------------------------------------ */
  18. /*                      constants used in strcvt function                   */
  19. /* ------------------------------------------------------------------------ */
  20.  
  21. #define NOBLANKS        0x0001  /* remove all blanks */
  22. #define NONONALPHA      0x0002  /* remove all non alphabetic characters */
  23. #define NONONNUMERIC    0x0004  /* remove all non numeric characters */
  24. #define NOLEADBLANKS    0x0008  /* remove all leading blanks */
  25. #define NOTRAILBLANKS   0x0010  /* remove trailing blanks */
  26. #define NOALPHA         0x0020  /* remove all alphabetic characters  */
  27. #define NONUMERIC       0x0040  /* remove all numeric characters */
  28. #define NOPUNCT         0x0080  /* remove all punctuation */
  29. #define TOSINGLE        0x0100  /* convert multiple blanks to single */
  30. #define TOUPPER         0x0200  /* convert lower case characters to upper */
  31. #define TOLOWER         0x0400  /* convert upper case characters to lower */
  32. #define TOPROPER        0x0800  /* capitalize all words */
  33. #define TOUNPROPER      0x1000  /* un - capitalize all words */
  34. #define TONOCR          0x2000  /* replace CR char with space */
  35.  
  36.  
  37.  
  38. /* ------------------------------------------------------------------------ */
  39. /*                            function prototypes                           */
  40. /* ------------------------------------------------------------------------ */
  41.  
  42. char  *strcomma         (long n);
  43. char  *strcvt           (char *d, char *s, int option, int ml);
  44. int   strisblank        (char *s);
  45. char  *strcode          (char *s, char *k);
  46. char  *strinsert        (char *a, char *s, int p);
  47. char  *strleft          (char *s, int n);
  48. char  *strljust         (char *s);
  49. char  *strltrim         (char *s);
  50. char  *strmiddle        (char *s, int p, int n);
  51. char  *strright         (char *s, int n);
  52. char  *strrjust         (char *s);
  53. char  *strrotleft       (char *s, int n);
  54. char  *strrotright      (char *s, int n);
  55. char  *strrtrim         (char *s);
  56. char  *strresize        (char *s, int n);
  57. char  *strshiftleft     (char *s, int n);
  58. char  *strshiftright    (char *s, int n);
  59. char  *strtrim          (char *s);
  60. char  *struplow         (char *s);
  61. int   touplow           (char *s, char *p, int c);
  62.  
  63. /* ------------------------------------------------------------------------ */
  64. /*                     case dependent string operations                     */
  65. /* ------------------------------------------------------------------------ */
  66.  
  67. int   strchangechar     (char *s, int a, int b);
  68. ulong strchecksum       (char *s);
  69. char  *strdelete        (char *a, char *s);
  70. char  *strdeleteall     (char *a, char *s);
  71. char  *strinc           (char *a, char *s);
  72. int   strcountchar      (char *s, int c);
  73. char  *strchangestr     (char *s, char *a, char *b);
  74. int   strcountstr       (char *a, char *s);
  75. char  *strsrep          (char *s, char *a, char *b);
  76.  
  77. /* ------------------------------------------------------------------------ */
  78. /*                     case  independent string operations                  */
  79. /* ------------------------------------------------------------------------ */
  80.  
  81. int   strichange        (char *s, int a, int b);
  82. ulong strichecksum      (char *s);
  83. char  *stridelete       (char *a, char *b);
  84. char  *strideleteall    (char *a, char *b);
  85. char  *striinc          (char *a, char *s);
  86. int   stricountchar     (char *s, int c);
  87. char  *strichangestr    (char *s, char *a, char *b);
  88. int   stricountstr      (char *a, char *s);
  89. char  *strisrep         (char *s, char *a, char *b);
  90.  
  91. /* ------------------------------------------------------------------------ */
  92. /*                                 macros                                   */
  93. /* ------------------------------------------------------------------------ */
  94.  
  95. #define  strleft(s,n)   strmiddle(s,0,n)
  96. #define  strright(s,n)  strmiddle(s,strlen(s)-n,n)
  97.  
  98.  
  99.  
  100.